﻿namespace PalletizationLib.Model
{
    public class Panel
    {
        public string Name { get; set; }
        /// <summary>
        /// 长度，只读不修改
        /// </summary>
        public double ImmutableLength { get; set; }
        /// <summary>
        /// 宽度，只读不修改
        /// </summary>
        public double ImmutableWidth { get; set; }

        public double Length { get; set; }
        public double Width { get; set; }

        public double Height { get; set; }
        /// <summary>
        /// 码垛高度，板件在当前的高度
        /// </summary>
        public double PalletizingHeight { get; set; }
        /// <summary>
        /// X坐标
        /// </summary>
        public double PositionX { get; set; }
        /// <summary>
        /// Y坐标
        /// </summary>
        public double PositionY { get; set; }
        /// <summary>
        /// 是否已分析
        /// </summary>
        public bool IsAnalyzed { get; set; }
        /// <summary>
        /// 远角,上一块板件的尾端(包括已扩展的尺寸)，可以理解为，放板前的剩余大小
        /// </summary>
        public double Diagonal { get; set; }
        /// <summary>
        /// 层数
        /// </summary>
        public int Layer { get; set; }
        /// <summary>
        /// 是否第一张
        /// </summary>
        public bool IsFirst { get; set; }
        /// <summary>
        /// 经过旋转
        /// </summary>
        public bool Rotate { get; set; }
        /// <summary>
        /// 放置位置
        /// </summary>
        public int Placement { get; set; }
        public string StackingTip { get; set; } = "";
        /// <summary>
        /// 是否需要铺平 ，1需要
        /// </summary>
        public int? ManualLeveling { get; set; } = 0;
        #region 条子需要参数
        public bool IsBottomPlate { get; set; }
        /// <summary>
        /// 条子序号
        /// </summary>
        public int StackNo { get; set; }


        #endregion
        public Panel DeepCopy()
        {
            return new Panel
            {
                Name = Name,
                ImmutableLength = ImmutableLength,
                ImmutableWidth = ImmutableWidth,
                Length = Length,
                Width = Width,
                Height = Height,
                PositionX = PositionX,
                PositionY = PositionY,
                Placement =Placement,
                IsAnalyzed = IsAnalyzed,
                PalletizingHeight =PalletizingHeight,
                Diagonal = Diagonal,
                Layer = Layer,
                IsFirst = IsFirst,
                Rotate = Rotate,
                StackingTip = StackingTip,
                ManualLeveling = ManualLeveling
            };
        }
    }




}
